import { useImperativeHandle, forwardRef } from "react";

export interface WorldAPI {
  a: number;
  b: number;
}

const World = forwardRef<WorldAPI>((props, ref) => {
  // 使用 useImperativeHandle 控制对外的暴露
  useImperativeHandle(ref, () => {
    return {
      a: 1,
      b: 2,
    };
  });

  return (
    <div>
      <h2>World</h2>
    </div>
  );
});

export default World;
